package com.example.leetdemo.finash;

public class Solution915 {

    public int partitionDisjoint(int[] nums) {
        int lm = nums[0];
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] >= lm) {
                boolean asb = true;
                for (int j = i; j < nums.length; j++) {
                    if (nums[j] < lm) {
                        asb = false;
                        break;
                    }
                }
                if (asb) {
                    return i;
                } else {
                    lm = nums[i];
                }
            }
        }
        return -1;
    }


    public static void main(String[] args) {
        Solution915 solution915 = new Solution915();
        System.err.println(solution915.partitionDisjoint(new int[] {1,1,1,0,6,9 }));
    }

}
